<?php
header("Access-Control-Allow-Origin: *");
$host = 'localhost:3306';
$user = 'root';
$pwd = 'root';
$dbname = 'test';
$connect = mysqli_connect(
    $host,
    $user,
    $pwd,
    $dbname
);
if (!$connect) {
    die('数据库连接失败');
}